//
// nmea0183.h
//
#ifndef __NMEA0183_H__
#define __NMEA0183_H__

typedef struct nmea_ymd
{
    short               m_year;
    char                m_month;
    char                m_day;
} nmea_ymd_t;

typedef struct nmea_time
{
    char                m_hour;
    char                m_minute;
    double              m_second;
} nmea_time_t;

typedef struct nmea_gga_desc
{
    char                m_flag;
    char                m_sat_num;

    nmea_time_t         m_time;
    
    double              m_lat;
    double              m_lon;
    double              m_height;
    double              m_hexp;
} nmea_gga_desc_t;

typedef struct nmea_rmc_desc
{
    char                m_flag;
    
    nmea_ymd_t          m_ymd;
    
} nmea_rmc_desc_t;

typedef struct nmea_desc_group
{
    nmea_gga_desc_t m_gga_desc;
    nmea_rmc_desc_t m_rmc_desc;
} nmea_desc_group_t;

const nmea_desc_group_t * nmea0183_desc_group(void);
int nmea0183_init(void);
int nmea0183_parse_gga(const char * p_str);
int nmea0183_parse_rmc(const char * p_str);
int nmea0183_parse_gsv(const char * p_str);
int nmea0183_parse_vtg(const char * p_str);

#endif

